<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<!-- Bootstrap -->
	<link href="../css/bootstrap.min.css" rel="stylesheet">
	<script type="text/javascript">
		$(function(){
			$("#username").change(function(){
				// $.get("user","username="+this.value+"&method=check",function(data){
					if(data==1){
						$("#usernameMsg").html("用户名已经存在").css("color","red");
						$("#registerBtn").attr("disabled",true);
					}else{
						$("#usernameMsg").html("用户名可用").css("color","green");
						$("#registerBtn").removeAttr("disabled");
					}
				})
			});
		})
	</script>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<title>登录</title>
	<script type="text/javascript">
		$(function(){
			$("#eye").click(function(){
				if($("#password").attr("type")=="password"){
					$("#password").attr("type","text");
					$("#eye").attr("class","glyphicon glyphicon-eye-close");
				}else{
					$("#password").attr("type","password");
					$("#eye").attr("class","glyphicon glyphicon-eye-open");
				}
			})
		})
	</script>
	<style type="text/css">
		#main{
			position: absolute;
			width: 400px;
			height: 250px;
			left:50%;
			top:40%;
			margin-left: -200px;
			margin-top: -100px;
		}
	</style>
</head>
<body>
<div class="regist">
	<div class="regist_center">
		<div class="regist_top">
			<div class="left fl"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;人员档案管理系统注册</div>
			<div class="clear"></div>
			<div class="xian center"></div>
		</div>
		<div class="center-block" style="margin-top: 80px;">
			<form class="form-horizontal" action="user?method=register" method="post">

				<div class="form-group">
					<label class="col-sm-2 control-label">用户名</label>
					<div class="col-sm-8" style="width: 40%">
						<input type="text" id="username" name="username" class="form-control col-sm-10"
							   placeholder="Username" />
					</div>
					<div class="col-sm-2">
						<p class="text-danger"><span class="help-block " id="usernameMsg"></span></p>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">密码</label>
					<div class="col-sm-8" style="width: 40%">
						<input type="password" name="password"
							   class="form-control col-sm-10" placeholder="Password" />
					</div>
					<div class="col-sm-2">
						<p class="text-danger"><span id="helpBlock" class="help-block ">请不输入6位以上字符</span></p>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">确认密码</label>
					<div class="col-sm-8" style="width: 40%">
						<input type="password"  class="form-control col-sm-10"
							   placeholder="Password Again" />
					</div>
					<div class="col-sm-2">
						<p class="text-danger"><span id="helpBlock" class="help-block ">两次密码要输入一致哦</span></p>
					</div>
				</div>



				<div class="form-group">
					<div class="col-sm-7 col-sm-push-2">
						<input id="registerBtn" type="submit" value="注册" class="btn btn-primary  btn-lg" style="width: 200px;" disabled/> &nbsp; &nbsp;
						<a href="${pageContext.request.contextPath }/login.jsp" target="_self">返回</a>
					</div>
				</div>
				<div>${registerMsg}</div>
			</form>

		</div>
	</div>
</div>

</body>
</html>
